const $http = (options) =>{
	return new Promise((resolve,reject) => {
		let {url,data={}} = options
		// console.log('name',url)
		let dataObj = {
			"user_id":"5eb6efffbae6ba004d1c74b2",
			...data
		}
		uniCloud.callFunction({
			name:url,
			data:dataObj
		}).then(res => {
			if(res.result.code === 200) {
				resolve(res.result)
			}else{
				reject(res.result)
			}
		}).catch(err => {
			reject(err)
		})
	})
}
export default $http;